
#ifndef LOD_VERTEX_H
#define LOD_VERTEX_H

#include <cmath>

#include "vector3.h"

//! Vertex
/*!
 * \param co_type A type used to represent coordinates of the vertex.*/
template<class co_type>
class vertex
{

    public:
    //! Vertex'es cartesian coordinates
    co_type x;
    co_type y;
    co_type z;

    //! Normal vector of this vertex
    vector3<co_type> normal;



    /*!
     * \param c Vertex'es coordinates
     * \param n Vertex'es normal vector's coordinates */
    vertex(const co_type* c, const co_type* n)
     : normal(n)
    {
        x = c[0];
        y = c[1];
        z = c[2];
    }

    vertex()
    {
    }

    
   /*!
    * \param v A vertex to compare this vertex with */
   bool operator== (const vertex & v) const
   {
      //todo: alternative: epsilon-accurate comparison
      return (x == v.x &&
              y == v.y &&
              z == v.z &&
              normal == v.normal);
   }
};

#endif // LOD_VERTEX_H
